<!DOCTYPE html>
<html>
<head>
    <meta name="layout" content="main"/>
    <g:set var="entityName" value="${message(code: 'RiskWarningLevel.label', default: 'riskWarningLevel')}"/>
    <title>风险等级</title>
</head>

<body class="fixed-navbar fixed-sidebar">
<div class="small-header">
    <div class="hpanel">
        <div class="panel-body">
            <div id="hbreadcrumb" class="pull-right">
                <ol class="hbreadcrumb breadcrumb">
                    <li>CINDATA PLS</li>
                    <li class="active">
                        <span>风险等级</span>
                    </li>
                </ol>
            </div>

            <h2 class="font-light m-b-xs">
                风险等级
            </h2>
        </div>
    </div>
</div>

<div class="content animate-panel">
    <div class="row">
        <g:form method="POST" action="index" class="form-horizontal" role="form">
            <div class="hpanel hblue">
                <div class="panel-heading">
                    <div class="panel-tools">
                        <button class="btn btn-primary btn-xs" type="submit"><i class="fa fa-search"></i>查询</button>
                        <button class="btn btn-warning2 btn-xs" type="button" id="resetBtn">
                            <i class="fa fa-times"></i>重置</button>
                    </div>
                    查询
                </div>
                <div class="panel-body seach-group">
                    <div class="row flex">
                        <div class="form-group col-md-4">
                            <label  class="col-sm-3 control-label">名称</label>
                            <div class="col-sm-9">
                                <input type="text" class="form-control" value="${params?.name}" id="name" name="name"/>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </g:form>
    </div>

    <div class="row">
        <div class="hpanel hgreen">
            <div class="panel-heading">
                <div class="panel-tools">
                    <g:link action="create" class="btn btn-info btn-xs"><i class="fa fa-plus"></i>新建</g:link>
                    <a class="showhide"><i class="fa fa-chevron-up"></i></a>
                </div>
                全部风险等级
            </div>

            <div class="panel-body no-padding">
                <div class="table-responsive">
                    <table cellpadding="1" cellspacing="1" class="table table-striped table-bordered table-hover text-center">
                        <thead>
                        <tr>
                            <g:sortableColumn property="name" title="名称" class="text-center" params="${params}"/>
                            <g:sortableColumn property="executeCycle" title="执行周期" class="text-center" params="${params}"/>
                            <g:sortableColumn property="description" title="描述" class="text-center" params="${params}"/>
                            <!-- <g:sortableColumn property="workflow" title="工作流" class="text-center" params="${params}"/> -->
                            <g:sortableColumn property="createdDate" title="创建时间" class="text-center" params="${params}"/>
                            <g:sortableColumn property="modifiedDate" title="修改时间" class="text-center" params="${params}"/>
                            <g:sortableColumn property="createBy" title="创建人" class="text-center" params="${params}"/>
                            <g:sortableColumn property="modifyBy" title="修改人" class="text-center" params="${params}"/>
                            <sec:ifAllGranted roles="ROLE_ADMINISTRATOR">
                                <g:sortableColumn property="operation" title="操作" class="text-center" params="${params}"/>
                            </sec:ifAllGranted>
                        </tr>
                        </thead>
                        <tbody>
                        <g:each in="${riskWarningLevelList}">
                            <tr align="center">
                                <td><g:link style="color: #3498DB" action="show" params="[id: it?.id]">${it?.name}</g:link></td>
                                <td>${it?.executeCycle} 天</td>
                                <td>${it?.description}</td>
                                <!-- <td>${it?.workflow?.name}</td> -->
                                <td>${it?.createdDate}</td>
                                <td>${it?.modifiedDate}</td>
                                <td>${it?.createBy?.fullName}</td>
                                <td>${it?.modifyBy?.fullName}</td>
                                <sec:ifAllGranted roles="ROLE_ADMINISTRATOR">
                                    <td width="8%" class="text-center">
                                        <g:form resource="${it}" method="DELETE">
                                            <button class="deleteBtn btn btn-danger btn-xs" type="button"><i class="fa fa-trash-o"></i> 删除</button>
                                        </g:form>
                                    </td>
                                </sec:ifAllGranted>
                            </tr>
                        </g:each>
                        </tbody>
                    </table>
                </div>
            </div>

            <div class="panel-footer">
                <div class="pagination">
                    <g:paginate action="index" total="${riskWarningLevelCount ?: 0}" params="${params}"/>
                </div>
            </div>
        </div>
    </div>
</div>

<g:javascript>
    $(function () 
    {
        //重置按钮
        $("#resetBtn").click(function () {
           $("#name").val("");
        });
    })
</g:javascript>

</body>
</html>
